package org.lc.design.samples.case1.strategy.impl;

import lombok.extern.slf4j.Slf4j;
import org.lc.design.samples.case1.constants.AccessControlMethodEnum;
import org.lc.design.samples.case1.strategy.AccessControlStrategy;

import java.util.Date;

/**
* 出入口控制-二维码识别策略实现
* @author lc
* @date 2024/7/5
*/
@Slf4j
public class QRCodeRecognitionStrategy implements AccessControlStrategy {

    @Override
    public boolean support(int accessControlMethod) {
        return AccessControlMethodEnum.QR_CODE.getCode() == accessControlMethod;
    }

    @Override
    public void passThrough(String userName, Date passTime) {
        log.info("{}通过{}方式通过大门门禁，通行时间：{}", userName, AccessControlMethodEnum.QR_CODE.getDesc(), passTime);
    }
}
